<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.72">
<link rel="alternate" type="application/rss+xml" href="/zh-cn.neutralinojs.github.io/blog/rss.xml" title="Neutralinojs Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/zh-cn.neutralinojs.github.io/blog/atom.xml" title="Neutralinojs Blog Atom Feed">
<link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://www.googletagmanager.com">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120983955-1"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-120983955-1",{anonymize_ip:!0})</script>
<script src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
<script src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" async></script><title data-react-helmet="true">Internal 命令行参数 | Neutralinojs</title><meta data-react-helmet="true" property="og:url" content="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/cli/internal-cli-arguments"><meta data-react-helmet="true" name="docusaurus_locale" content="en"><meta data-react-helmet="true" name="docusaurus_version" content="current"><meta data-react-helmet="true" name="docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:title" content="Internal 命令行参数 | Neutralinojs"><meta data-react-helmet="true" name="description" content="neu CLI 封装了 Neutralinojs 的内部 CLI 参数，为开发者提供了一个简单的接口。例如，在 Linux 上，neu run 命令在内部调用"><meta data-react-helmet="true" property="og:description" content="neu CLI 封装了 Neutralinojs 的内部 CLI 参数，为开发者提供了一个简单的接口。例如，在 Linux 上，neu run 命令在内部调用"><link data-react-helmet="true" rel="shortcut icon" href="/zh-cn.neutralinojs.github.io/img/favicon.png"><link data-react-helmet="true" rel="canonical" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/cli/internal-cli-arguments"><link data-react-helmet="true" rel="alternate" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/cli/internal-cli-arguments" hreflang="en"><link data-react-helmet="true" rel="alternate" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/cli/internal-cli-arguments" hreflang="x-default"><link rel="stylesheet" href="/zh-cn.neutralinojs.github.io/assets/css/styles.b7ecac1c.css">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/styles.c25d7c9f.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/runtime~main.da1bdab8.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/main.22927eab.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/1.a80d899d.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/2.818fc9a7.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/49.8e895b96.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/50.816652b0.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/935f2afb.a67ede05.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/17896441.74f92a0c.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/eb5e7135.f740775b.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<div><a href="#main" class="skipToContent_1oUP">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle" type="button" tabindex="0"><svg aria-label="Menu" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/zh-cn.neutralinojs.github.io/"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">Neutralinojs</strong></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/">文档</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/apps/">应用</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/resources/">资源</a><a href="https://www.youtube.com/c/CodeZri" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">视频</a><a href="https://codezri.org/blog/neutralinojs-2024-roadmap" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">路线图</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">发布说明</a><a href="https://github.com/neutralinojs/gsoc2024" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GSoC 2024</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub</a><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">❤️ 捐赠</a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_GrZ2"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_71bT">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_71bT">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/zh-cn.neutralinojs.github.io/"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">Neutralinojs</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/">文档</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/apps/">应用</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/resources/">资源</a></li><li class="menu__list-item"><a href="https://www.youtube.com/c/CodeZri" target="_blank" rel="noopener noreferrer" class="menu__link">视频</a></li><li class="menu__list-item"><a href="https://codezri.org/blog/neutralinojs-2024-roadmap" target="_blank" rel="noopener noreferrer" class="menu__link">路线图</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">发布说明</a></li><li class="menu__list-item"><a href="https://github.com/neutralinojs/gsoc2024" target="_blank" rel="noopener noreferrer" class="menu__link">GSoC 2024</a></li><li class="menu__list-item"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="menu__link">GitHub</a></li><li class="menu__list-item"><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="menu__link">❤️ 捐赠</a></li></ul></div></div></div></nav><div class="main-wrapper main-docs-wrapper"><div class="docPage_31aa"><div class="docSidebarContainer_3Kbt" role="complementary"><div class="sidebar_15mo"><div class="menu menu--responsive thin-scrollbar menu_Bmed"><button aria-label="Open menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_fgN0" width="24" height="24" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">入门指南</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/">简介</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/getting-started/your-first-neutralinojs-app">您的第一个Neutralinojs应用</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/getting-started/using-frontend-libraries">使用前端库</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">原生 API</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/overview">原生API概览</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/app">Neutralino.app</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/clipboard">Neutralino.clipboard</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/computer">Neutralino.computer</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/custom">Neutralino.custom</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/debug">Neutralino.debug</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/events">Neutralino.events</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/extensions">Neutralino.extensions</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/filesystem">Neutralino.filesystem</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/init">Neutralino.init</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/os">Neutralino.os</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/storage">Neutralino.storage</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/updater">Neutralino.updater</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/window">Neutralino.window</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/error-codes">错误码</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/global-variables">全局变量</a></li></ul></li><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#!">CLI</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/cli/neu-cli">neu CLI</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/cli/internal-cli-arguments">Internal 命令行参数</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">配置</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/neutralino.config.json">neutralino.config.json</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/project-structure">项目结构</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/modes">模式</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">如何操作</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/how-to/extensions-overview">扩展概述</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/how-to/auto-updater">自动更新器</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">分发</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/distribution/overview">分发概述</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">贡献</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide">框架开发指南</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/architecture">架构</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/security">安全性</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/code-style-guide">代码风格指南</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/developer-support">开发者支持</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/committers">提交者</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/frequently-asked-questions">常见问题解答</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/about-neutralinojs">关于 Neutralinojs</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">发布说明</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">框架</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/release-notes/cli">命令行</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/release-notes/client-library">客户端</a></li></ul></li></ul></div></div></div><main class="docMainContainer_3ufF"><div class="container padding-vert--lg docItemWrapper_3FMP"><div class="row"><div class="col docItemCol_2rXS"><div class="docItemContainer_1EXp"><article><header><h1 class="docTitle_1vX4">Internal 命令行参数</h1></header><div class="markdown"><p>neu CLI 封装了 Neutralinojs 的内部 CLI 参数，为开发者提供了一个简单的接口。例如，在 Linux 上，<code>neu run</code> 命令在内部调用
<code>./bin/neutralino-linux_x64 --load-dir-res --path=. --neu-dev-extension --neu-dev-auto-reload</code>。
您可以使用 neu CLI、Node.js 和 npm 来构建 Neutralinojs 应用。但是，neu CLI
为应用开发者提供了一个简单、快速且易于使用的工具来创建、管理和打包 Neutralinojs 应用。</p><p>Neutralinojs 支持以下 CLI 参数。许多内部 CLI 参数帮助开发者覆盖在<a href="/zh-cn.neutralinojs.github.io/docs/configuration/neutralino.config.json"><code>neutralino.config.json</code></a> 文件中定义的默认配置。如果您在源文件中通过子进程 API 使用 Neutralinojs，您可以使用以下参数来配置应用实例。</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="general"></a>General<a class="hash-link" href="#general" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--load-dir-res"></a><code>--load-dir-res</code><a class="hash-link" href="#--load-dir-res" title="Direct link to heading">#</a></h3><p>通知 Neutralinojs 服务器从资源目录获取文件。如果没有提供这个标志，
Neutralinojs 服务器将从 <code>resources.neu</code> 文件加载资源。</p><div class="admonition admonition-tip alert alert--success"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</h5></div><div class="admonition-content"><p>如果 Neutralinojs 未能加载资源 <code>resources.neu</code>，
这个标志会自动启用以从应用目录找到资源。
因此，在开发应用时，您可以双击二进制文件而不是使用 <code>neu run</code>。</p></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--config-filefilename"></a><code>--config-file=&lt;filename&gt;</code><a class="hash-link" href="#--config-filefilename" title="Direct link to heading">#</a></h3><p>使用自定义配置文件代替默认的 <code>neutralino.config.json</code> 文件来加载应用配置 JSON。这个 CLI 选项对于设置仅限开发的配置文件很有帮助（即 <code>--config-file=neutralino-dev.config.json</code>）。</p><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</h5></div><div class="admonition-content"><p><code>neu build</code> 命令通常不会
将自定义配置文件包含在最终的应用程序包中——它只嵌入默认的
<code>neutralino.config.json</code> 文件，让您可以存储生产应用程序配置。</p></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--pathpath"></a><code>--path=&lt;path&gt;</code><a class="hash-link" href="#--pathpath" title="Direct link to heading">#</a></h3><p>用相对路径或绝对路径覆盖资源路径。这将改变 <code>NL_PATH</code> 全局变量。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--modemode"></a><code>--mode=&lt;mode&gt;</code><a class="hash-link" href="#--modemode" title="Direct link to heading">#</a></h3><p>覆盖默认模式。接受的值有：<code>window</code>、<code>browser</code> 和 <code>cloud</code>。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--neu-dev-auto-reload"></a><code>--neu-dev-auto-reload</code><a class="hash-link" href="#--neu-dev-auto-reload" title="Direct link to heading">#</a></h3><p>监听 <code>neuDev_reloadApp</code> 事件。提供此 CLI 参数时，对资源的每次修改都会自动重新加载应用程序。默认情况下，<code>neu run</code> 命令执行带有此标志的 Neutralinojs。</p><p><code>--neu-dev-</code> 是 Neutralinojs 进程的保留 CLI 参数前缀。因此，请避免添加自定义参数，以 <code>--neu-dev-</code> 前缀开头。对于与开发相关的 CLI 标志，可以自由使用 <code>--dev-</code> 前缀。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--neu-dev-extension"></a><code>--neu-dev-extension</code><a class="hash-link" href="#--neu-dev-extension" title="Direct link to heading">#</a></h3><p>为开发目的在内部加载 <code>js.neutralino.devtools</code> 扩展。neu CLI 使用此 CLI 参数与应用程序进程建立 IPC。此选项仅在从目录加载应用程序资源时有效（对最终用户无效）。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--urlurl"></a><code>--url=&lt;url&gt;</code><a class="hash-link" href="#--urlurl" title="Direct link to heading">#</a></h3><p>覆盖应用程序的 URL。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--portport"></a><code>--port=&lt;port&gt;</code><a class="hash-link" href="#--portport" title="Direct link to heading">#</a></h3><p>覆盖应用程序端口，并将改变 <code>NL_PORT</code> 全局变量。如果给定 <code>0</code>，Neutralino 将使用随机可用端口。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--logging-enabledtruefalse"></a><code>--logging-enabled=&lt;true|false&gt;</code><a class="hash-link" href="#--logging-enabledtruefalse" title="Direct link to heading">#</a></h3><p>覆盖日志功能状态。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--logging-write-to-log-filetruefalse"></a><code>--logging-write-to-log-file=&lt;true|false&gt;</code><a class="hash-link" href="#--logging-write-to-log-filetruefalse" title="Direct link to heading">#</a></h3><p>覆盖日志文件功能状态。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--export-auth-infotruefalse"></a><code>--export-auth-info=&lt;true|false&gt;</code><a class="hash-link" href="#--export-auth-infotruefalse" title="Direct link to heading">#</a></h3><p>覆盖验证详细信息导出设置。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--enable-extensionstruefalse"></a><code>--enable-extensions=&lt;true|false&gt;</code><a class="hash-link" href="#--enable-extensionstruefalse" title="Direct link to heading">#</a></h3><p>覆盖扩展功能的可用性。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--enable-servertruefalse"></a><code>--enable-server=&lt;true|false&gt;</code><a class="hash-link" href="#--enable-servertruefalse" title="Direct link to heading">#</a></h3><p>启用或禁用后台服务器（禁用静态文件服务器功能和本地 API 消息传递）。
如果您将远程 URL 加载到 webview，可以将此选项设置为 <code>true</code>。</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="window-mode"></a>Window mode<a class="hash-link" href="#window-mode" title="Direct link to heading">#</a></h2><p>当应用程序以窗口模式运行时使用以下 CLI 参数。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-titletitle"></a><code>--window-title=&lt;title&gt;</code><a class="hash-link" href="#--window-titletitle" title="Direct link to heading">#</a></h3><p>覆盖窗口标题。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-iconicon_path"></a><code>--window-icon=&lt;icon_path&gt;</code><a class="hash-link" href="#--window-iconicon_path" title="Direct link to heading">#</a></h3><p>覆盖窗口图标。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-full-screentruefalse"></a><code>--window-full-screen=&lt;true|false&gt;</code><a class="hash-link" href="#--window-full-screentruefalse" title="Direct link to heading">#</a></h3><p>覆盖窗口初始全屏状态。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-always-on-toptruefalse"></a><code>--window-always-on-top=&lt;true|false&gt;</code><a class="hash-link" href="#--window-always-on-toptruefalse" title="Direct link to heading">#</a></h3><p>覆盖窗口最初的最上模式。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-borderlesstruefalse"></a><code>--window-borderless=&lt;true|false&gt;</code><a class="hash-link" href="#--window-borderlesstruefalse" title="Direct link to heading">#</a></h3><p>覆盖窗口的无边框模式。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-maximizetruefalse"></a><code>--window-maximize=&lt;true|false&gt;</code><a class="hash-link" href="#--window-maximizetruefalse" title="Direct link to heading">#</a></h3><p>覆盖窗口初始最大化状态。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-hiddentruefalse"></a><code>--window-hidden=&lt;true|false&gt;</code><a class="hash-link" href="#--window-hiddentruefalse" title="Direct link to heading">#</a></h3><p>覆盖窗口初始可见性状态。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-maximizabletruefalse"></a><code>--window-maximizable=&lt;true|false&gt;</code><a class="hash-link" href="#--window-maximizabletruefalse" title="Direct link to heading">#</a></h3><p>覆盖窗口初始可最大化状态。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-widthnumber"></a><code>--window-width=&lt;number&gt;</code><a class="hash-link" href="#--window-widthnumber" title="Direct link to heading">#</a></h3><p>覆盖窗口宽度。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-heightnumber"></a><code>--window-height=&lt;number&gt;</code><a class="hash-link" href="#--window-heightnumber" title="Direct link to heading">#</a></h3><p>覆盖窗口高度。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-min-widthnumber"></a><code>--window-min-width=&lt;number&gt;</code><a class="hash-link" href="#--window-min-widthnumber" title="Direct link to heading">#</a></h3><p>覆盖窗口最小宽度。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-min-heightnumber"></a><code>--window-min-height=&lt;number&gt;</code><a class="hash-link" href="#--window-min-heightnumber" title="Direct link to heading">#</a></h3><p>覆盖窗口最小高度。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-max-widthnumber"></a><code>--window-max-width=&lt;number&gt;</code><a class="hash-link" href="#--window-max-widthnumber" title="Direct link to heading">#</a></h3><p>覆盖窗口最大宽度。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-max-heightnumber"></a><code>--window-max-height=&lt;number&gt;</code><a class="hash-link" href="#--window-max-heightnumber" title="Direct link to heading">#</a></h3><p>覆盖窗口最大高度。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-xnumber"></a><code>--window-x=&lt;number&gt;</code><a class="hash-link" href="#--window-xnumber" title="Direct link to heading">#</a></h3><p>覆盖窗口左侧（<code>x</code>）位置。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-ynumber"></a><code>--window-y=&lt;number&gt;</code><a class="hash-link" href="#--window-ynumber" title="Direct link to heading">#</a></h3><p>覆盖窗口顶部（<code>y</code>）位置。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-centertruefalse"></a><code>--window-center=&lt;true|false&gt;</code><a class="hash-link" href="#--window-centertruefalse" title="Direct link to heading">#</a></h3><p>覆盖窗口初始居中设置。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-resizabletruefalse"></a><code>--window-resizable=&lt;true|false&gt;</code><a class="hash-link" href="#--window-resizabletruefalse" title="Direct link to heading">#</a></h3><p>覆盖窗口初始可调整大小状态。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-exit-process-on-closetruefalse"></a><code>--window-exit-process-on-close=&lt;true|false&gt;</code><a class="hash-link" href="#--window-exit-process-on-closetruefalse" title="Direct link to heading">#</a></h3><p>覆盖关闭按钮的行为。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-enable-inspectortruefalse"></a><code>--window-enable-inspector=&lt;true|false&gt;</code><a class="hash-link" href="#--window-enable-inspectortruefalse" title="Direct link to heading">#</a></h3><p>自动打开开发者工具窗口。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-use-saved-statetruefalse"></a><code>--window-use-saved-state=&lt;true|false&gt;</code><a class="hash-link" href="#--window-use-saved-statetruefalse" title="Direct link to heading">#</a></h3><p>覆盖保存窗口状态功能设置。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--window-extend-user-agent-withsuffix"></a><code>--window-extend-user-agent-with=&lt;suffix&gt;</code><a class="hash-link" href="#--window-extend-user-agent-withsuffix" title="Direct link to heading">#</a></h3><p>覆盖自定义用户代理设置。</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="chrome-mode"></a>Chrome mode<a class="hash-link" href="#chrome-mode" title="Direct link to heading">#</a></h2><p>当应用程序以 chrome 模式运行时使用以下 CLI 参数。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--chrome-widthnumber"></a><code>--chrome-width=&lt;number&gt;</code><a class="hash-link" href="#--chrome-widthnumber" title="Direct link to heading">#</a></h3><p>Chrome 窗口宽度。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--chrome-heightnumber"></a><code>--chrome-height=&lt;number&gt;</code><a class="hash-link" href="#--chrome-heightnumber" title="Direct link to heading">#</a></h3><p>Chrome 窗口高度。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="--chrome-argsarg_list"></a><code>--chrome-args=&lt;arg_list&gt;</code><a class="hash-link" href="#--chrome-argsarg_list" title="Direct link to heading">#</a></h3><p>Chrome 进程的额外参数。从<a href="/zh-cn.neutralinojs.github.io/docs/configuration/modes#chrome">这里</a>阅读更多关于 chrome 模式的信息。</p><div class="admonition admonition-tip alert alert--success"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</h5></div><div class="admonition-content"><p>对于布尔类型的 CLI 参数，右手值是可选的。因此，您可以使用 <code>--window-full-screen</code>
代替 <code>--window-full-screen=true</code>。然而，如果您定义了 <code>window.fullScreen</code> 为 <code>true</code> 并且需要将其覆盖为
<code>false</code> 您必须使用 <code>--window-full-screen=false</code>。</p></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/neutralinojs/neutralinojs.github.io/edit/main/docs/cli/internal-cli-arguments.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 40 40" class="iconEdit_2_ui" aria-label="Edit page"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Docs pages navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/zh-cn.neutralinojs.github.io/docs/cli/neu-cli"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« neu CLI</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/zh-cn.neutralinojs.github.io/docs/configuration/neutralino.config.json"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">neutralino.config.json »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_1nbE thin-scrollbar"><div><div data-ea-publisher="neutralino" data-ea-type="image" id="neutralino-docs"></div></div><ul class="table-of-contents table-of-contents__left-border"><li><a href="#general" class="table-of-contents__link">General</a><ul><li><a href="#--load-dir-res" class="table-of-contents__link"><code>--load-dir-res</code></a></li><li><a href="#--config-filefilename" class="table-of-contents__link"><code>--config-file=&lt;filename&gt;</code></a></li><li><a href="#--pathpath" class="table-of-contents__link"><code>--path=&lt;path&gt;</code></a></li><li><a href="#--modemode" class="table-of-contents__link"><code>--mode=&lt;mode&gt;</code></a></li><li><a href="#--neu-dev-auto-reload" class="table-of-contents__link"><code>--neu-dev-auto-reload</code></a></li><li><a href="#--neu-dev-extension" class="table-of-contents__link"><code>--neu-dev-extension</code></a></li><li><a href="#--urlurl" class="table-of-contents__link"><code>--url=&lt;url&gt;</code></a></li><li><a href="#--portport" class="table-of-contents__link"><code>--port=&lt;port&gt;</code></a></li><li><a href="#--logging-enabledtruefalse" class="table-of-contents__link"><code>--logging-enabled=&lt;true|false&gt;</code></a></li><li><a href="#--logging-write-to-log-filetruefalse" class="table-of-contents__link"><code>--logging-write-to-log-file=&lt;true|false&gt;</code></a></li><li><a href="#--export-auth-infotruefalse" class="table-of-contents__link"><code>--export-auth-info=&lt;true|false&gt;</code></a></li><li><a href="#--enable-extensionstruefalse" class="table-of-contents__link"><code>--enable-extensions=&lt;true|false&gt;</code></a></li><li><a href="#--enable-servertruefalse" class="table-of-contents__link"><code>--enable-server=&lt;true|false&gt;</code></a></li></ul></li><li><a href="#window-mode" class="table-of-contents__link">Window mode</a><ul><li><a href="#--window-titletitle" class="table-of-contents__link"><code>--window-title=&lt;title&gt;</code></a></li><li><a href="#--window-iconicon_path" class="table-of-contents__link"><code>--window-icon=&lt;icon_path&gt;</code></a></li><li><a href="#--window-full-screentruefalse" class="table-of-contents__link"><code>--window-full-screen=&lt;true|false&gt;</code></a></li><li><a href="#--window-always-on-toptruefalse" class="table-of-contents__link"><code>--window-always-on-top=&lt;true|false&gt;</code></a></li><li><a href="#--window-borderlesstruefalse" class="table-of-contents__link"><code>--window-borderless=&lt;true|false&gt;</code></a></li><li><a href="#--window-maximizetruefalse" class="table-of-contents__link"><code>--window-maximize=&lt;true|false&gt;</code></a></li><li><a href="#--window-hiddentruefalse" class="table-of-contents__link"><code>--window-hidden=&lt;true|false&gt;</code></a></li><li><a href="#--window-maximizabletruefalse" class="table-of-contents__link"><code>--window-maximizable=&lt;true|false&gt;</code></a></li><li><a href="#--window-widthnumber" class="table-of-contents__link"><code>--window-width=&lt;number&gt;</code></a></li><li><a href="#--window-heightnumber" class="table-of-contents__link"><code>--window-height=&lt;number&gt;</code></a></li><li><a href="#--window-min-widthnumber" class="table-of-contents__link"><code>--window-min-width=&lt;number&gt;</code></a></li><li><a href="#--window-min-heightnumber" class="table-of-contents__link"><code>--window-min-height=&lt;number&gt;</code></a></li><li><a href="#--window-max-widthnumber" class="table-of-contents__link"><code>--window-max-width=&lt;number&gt;</code></a></li><li><a href="#--window-max-heightnumber" class="table-of-contents__link"><code>--window-max-height=&lt;number&gt;</code></a></li><li><a href="#--window-xnumber" class="table-of-contents__link"><code>--window-x=&lt;number&gt;</code></a></li><li><a href="#--window-ynumber" class="table-of-contents__link"><code>--window-y=&lt;number&gt;</code></a></li><li><a href="#--window-centertruefalse" class="table-of-contents__link"><code>--window-center=&lt;true|false&gt;</code></a></li><li><a href="#--window-resizabletruefalse" class="table-of-contents__link"><code>--window-resizable=&lt;true|false&gt;</code></a></li><li><a href="#--window-exit-process-on-closetruefalse" class="table-of-contents__link"><code>--window-exit-process-on-close=&lt;true|false&gt;</code></a></li><li><a href="#--window-enable-inspectortruefalse" class="table-of-contents__link"><code>--window-enable-inspector=&lt;true|false&gt;</code></a></li><li><a href="#--window-use-saved-statetruefalse" class="table-of-contents__link"><code>--window-use-saved-state=&lt;true|false&gt;</code></a></li><li><a href="#--window-extend-user-agent-withsuffix" class="table-of-contents__link"><code>--window-extend-user-agent-with=&lt;suffix&gt;</code></a></li></ul></li><li><a href="#chrome-mode" class="table-of-contents__link">Chrome mode</a><ul><li><a href="#--chrome-widthnumber" class="table-of-contents__link"><code>--chrome-width=&lt;number&gt;</code></a></li><li><a href="#--chrome-heightnumber" class="table-of-contents__link"><code>--chrome-height=&lt;number&gt;</code></a></li><li><a href="#--chrome-argsarg_list" class="table-of-contents__link"><code>--chrome-args=&lt;arg_list&gt;</code></a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">文档</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/">入门</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/api/overview">API参考</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/cli/neu-cli">CLI</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/configuration/modes">模式</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide">贡献</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">社区</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://twitter.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter</a></li><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stack Overflow</a></li><li class="footer__item"><a href="https://medium.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Medium</a></li><li class="footer__item"><a href="https://www.youtube.com/watch?v=txDlNNsgSh8&amp;list=PLvTbqpiPhQRb2xNQlwMs0uVV0IN8N-pKj&amp;ab_channel=CodeZri" target="_blank" rel="noopener noreferrer" class="footer__link-item">YouTube</a></li><li class="footer__item"><a href="https://join.slack.com/t/neutralinojs/shared_invite/zt-b7mbivj5-pKpO6U5drmeT68vKD_pc6w" target="_blank" rel="noopener noreferrer" class="footer__link-item">Slack</a></li><li class="footer__item"><a href="https://discord.gg/cybpp4guTJ" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord</a></li><li class="footer__item"><a href="https://www.reddit.com/r/neutralinojs/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Reddit</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">更多</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/neutralinojs/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="footer__link-item">Patreon</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/privacy-policy">隐私政策</a></li><li class="footer__item"><a href="https://codezri.org/blog/" target="_blank" rel="noopener noreferrer" class="footer__link-item">博客</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 Neutralinojs | innovation by <a href="https://codezri.org/">CodeZri.org</a></div></div></div></footer></div>
<script src="/zh-cn.neutralinojs.github.io/assets/js/styles.c25d7c9f.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/runtime~main.da1bdab8.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/main.22927eab.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/1.a80d899d.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/2.818fc9a7.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/49.8e895b96.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/50.816652b0.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/935f2afb.a67ede05.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/17896441.74f92a0c.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/eb5e7135.f740775b.js"></script>
</body>
</html>